Post

Replies

Boosts

Views

Activity

Reply to CoreData result class has 'Sendable' warnings
My solution: Add a struct with the same var names as the CoreData Entity class. Add one more var to hold the NSManagedObjectID. Add a method (#asStruct) to copy all of the values in the Entity class to the struct. Everywhere the Entity class was used, change the reference to the new struct. Finally on the save operation use the NSManagedObjectID to get the managed object back from the data context and update the managed object values as needed from the struct. Only one of the 18 CoreData entity classes needed this fix. The other 17 lower level entities apparently did not cross the NSDiffableDataSourceSnapshot/Entity class isolation boundary and thus do not cause the 'Sendable' warning. It would be nice if the CoreData data model supported an option to create either a struct or an Entity class. This would (I guess) save a lot of code changes where two frameworks have interfaces.
Jun ’24
Reply to xCode 13 install causes iMac reboot
Fixed the issue and installed xCode 13 by deleting the Norton Security App. By the way - the new permission setting procedure to enable system extensions is interesting.. It is shutdown, restart into the OS Recovery environment, then enable kernel extensions from a Security Policy button. More than one confirming admin password entry is required. It's fine with me, I like security !
Sep ’21
Reply to Update to UITableViewDiffableDataSource row
After a nice discussion at a WWDC 2020 lab the solution has been found. And yes I did miss the simple way.. oh well, live and learn. The answer is that uiState is cached and the dataSource needs to be notified of the change. The missing line after updateItem.stateVar = true snapshot.reloadItems([updateItem]) Now apply the change dataSource.apply(snapshot) thank you Apple engineer ! Will
Jun ’20
Reply to Persistence of photo access permission ?
Apologies on the typo, I was asking about PHPicker. I recall something about a cloud identifier.. should that be used for persistent storage in the app context in place of local identifier? My app basically stores metadata of the ciFilter set and the image local identifier but does not save a new image. This is because localIdentifier is documented as “a unique string that persistently identifies the object” (class PHObject). Is this changing too?
Jun ’20